﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Collections.Generic;
using System.Data;
using System.Xml;

public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }

    protected void Tick(object sender, EventArgs e)
    {
        //Get Yahoo Weather forecast RSS feed
        string RSS = "http://weather.yahooapis.com/forecastrss?w=12800712&u=c";

        //Create Xml document parser
        XmlDocument xDoc = new XmlDocument();
        xDoc.Load(RSS);

        //Create a node list
        XmlNodeList ItemList = xDoc.GetElementsByTagName("item");

        //Get title and description
        string Title = ItemList[0].SelectSingleNode("title").InnerText;
        string Description = ItemList[0].SelectSingleNode("description").InnerText;

        //Add weather control to the page
        WeatherUpdatePanel.Controls.Add(new LiteralControl("<p>" + Title + "</p>"));
        WeatherUpdatePanel.Controls.Add(new LiteralControl("<p>" + Description + "</p>"));
    }
}